package cn.com.thinker.ds.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * Created by crazyHC on 2017/6/13.
 */
@Configuration
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"cn.com.thinker"})
public class ThinDsConfig {

    @Autowired
    private RestTemplateBuilder builder;


    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return builder.build();
    }

}
